home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1986 July & August
/
rerun-1986-07-08.d64
/
menu subroutine
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
64 lines
102 rem *****************************
104 rem * *
106 rem * menu subroutine *
108 rem * demonstration program *
112 rem * *
114 rem *****************************
116 rem
118 rem reserve p$, poke machine language
120 p$="" : c=0 : for i=50176 to 50323 : read j : poke i,j : c=c+j : next
130 if c <> 17444 then print "error in data statements!" : end
132 rem
134 rem set k$ array to represent
136 rem character color choices
138 k$(1)=chr$(144) : k$(2)=chr$(5) : k$(3)=chr$(28) : k$(4)=chr$(159)
142 k$(5)=chr$(156) : k$(6)=chr$(30) : k$(7)=chr$(31) : k$(8)=chr$(158)
144 rem
146 rem set pn and variable for border
148 rem color choice menu
149 pn=15 : p$="^black^white^red^cyan^purple^green^blue^yellow^orange"
151 p$=p$ + "^brown^light red^dark gray^light gray^light green^light blue"
152 print"[147]"
153 print" what color should the border be?" : print : gosub500 :poke53280,p-1
154 rem
156 rem now do the background
158 print"[147]"
162 print" what color should the background be?" : print :gosub500:poke53281,p-1
164 print"[147]"
166 rem
168 rem use a different menu with less
172 rem choices for character color
174 p$="^black^white^red^cyan^purple^green^blue"
176 print" what color should the characters be?":print:gosub500:printk$(p):end
476 rem
478 rem
482 rem ****************************
484 rem * *
486 rem * menu subroutine *
488 rem * *
492 rem ****************************
494 rem
496 rem set up and jump to machine
498 rem language routine to print menu
500 poke50179,pn : sys50176 : ph=peek(50180)
502 rem language routine to print menu
512 rem
514 rem now input a choice
520 print:print""tab(15)"choice [157][157][157][157][157][157][157][157][157][157][157]"; : inputpt$ :p=val(pt$)
530 ifp>0 and p<=ph then return
540 print" choose a value between 1 and"ph"[145][145][145][145][145][145][145]" : goto520
586 rem
588 rem
592 rem these are the data statements
594 rem representing the machine
596 rem language routine that prints
598 rem the menu
600 data 76,8,196,0,0,0,0,0,160,2,177,45,141,5,196,200,177,45,133,251,200,177
610 data 45,133,252,169,0,141,4,196,169,48,141,6,196,141,7,196,160,0,177,251
620 data 201,94,208,84,169,13,32,210,255,174,3,196,138,201,0,240,9,169,32,32
630 data 210,255,202,76,54,196,173,4,196,24,105,1,141,4,196,173,6,196,201,48
640 data 208,2,169,32,32,210,255,173,7,196,201,56,208,9,173,6,196,24,105,1,141
650 data 6,196,173,7,196,201,57,208,2,169,47,24,105,1,32,210,255,141,7,196,169
660 data 41,32,210,255,169,32,32,210,255,200,173,5,196,56,233,1,141,5,196,201
670 data 0,208,149,96